<template>
  <div
    style="display: flex; flex-direction: column; align-items: center; flex: 1"
    class="animate__animated animate__fadeInLeft"
  >
    <ImgCutter @cutDown="cutDown"> </ImgCutter>
    <img :src="userinfo.avatar" />

    <h2>修改头像</h2>
  </div>
</template>

<script>
import ImgCutter from "vue-img-cutter";
import { mapState } from "vuex";
export default {
  name: "UserInfoAvatar",
  props: {},
  data() {
    return {
      form: {},
    };
  },
  components: {
    ImgCutter,
  },
  computed: {
    ...mapState("user", ["userinfo"]),
  },
  methods: {
    //通过cutDown事件接收选择的图片信息
    cutDown(event) {
      console.log(event);
    },
  },
};
</script>
<style lang="scss" scoped>
.user-info img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.el-avatar {
  margin-top: 20px;
}
.el-avatar--circle {
  margin-top: 20px;
}
</style>
